package com.mpq.service;


import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author lqh
 * @since 2018-12-03
 */
@Service
public class AsyncService {
    @Async
    public void task1() throws InterruptedException{
        Thread.sleep(2000);
        System.out.println("完成任务1");
    }
    @Async
    public void task2() throws InterruptedException{
        Thread.sleep(1000);
        System.out.println("完成任务2");
    }
}
